$(function() {
  			var url = "http://localhost:8080/login.html";
  			$('<iframe id="main-frame" height="100%" width="100%" scrolling="auto" frameborder="0"></iframe>').appendTo("body").attr("src",url); 

  			

	  		function getMac(){
	  			var address = require('address');
	  			var dateAddr = new Date();
				address(function (err, addrs) {
					console.log(addrs.ip, addrs.ipv6, addrs.mac);
					addrObj = addrs;
					// alert("index----addrs" + JSON.stringify(addrs));
					console.log("index----addrs" + JSON.stringify(addrs));
				});
				console.log("addrs---time", new Date() - dateAddr);


				var arp = require('arptable-js');
				var dateMacs = new Date();
				arp.get(function(table){
				  macsObj = table;
				  // alert("index------data" + JSON.stringify(macsObj)); 
				  console.log("index------data" + JSON.stringify(macsObj)); 
				},function(error){
					alert("获取出错", error);
					console.log("获取出错",error);
					getMac();
				});
				console.log("dateMacs----time", new Date() - dateMacs);

	  		}  	


	  		var funcTick = setInterval(function(){

  				var that = document.getElementById("main-frame").contentWindow; 

  				if(that.loadFunc){
  					console.log("loadFunc---------");
					that.loadFunc(win, gui);
  					clearInterval(funcTick);
				}

  			}, 200);		

	  				
	  		var versionTick = setInterval(function(){

  				var that = document.getElementById("main-frame").contentWindow; 


  				if(that.loadVersion){
  					console.log("loadVersion---------");
					that.loadVersion(2.1);
  					clearInterval(versionTick);
				}

				
				
  			}, 200);		


  			var macTick =  setInterval(function(){

  				var that = document.getElementById("main-frame").contentWindow; 


  				if(that.loadMac && addrObj && macsObj){

  					that.loadMac(addrObj, macsObj);

  					clearInterval(macTick);
  				}
												
  			}, 200);

  			getMac();
  		});